<!DOCTYPE html>
<html lang="zh">

<head>
	<link rel="icon" href="https://qzonestyle.gtimg.cn/aoi/img/logo/favicon.ico">
	<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>QQ空间备份-收藏夹</title>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
	<link rel="stylesheet" type="text/css" href="../common/css/common.css">
	<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.0/dist/jquery.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
	<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
	<script type="text/javascript" src="../common/js/sidebar.js"></script>
</head>

<body>
	<header>
		<nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-dark">
			<a class="navbar-brand" target="_blank" href="https://github.com/ShunCai/QZoneExport">QQ空间导出助手</a>
			<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
				<span class="navbar-toggler-icon"></span>
			</button>
			<div class="collapse navbar-collapse" id="navbarSupportedContent">
				<nav aria-label="breadcrumb">
					<ol class="breadcrumb bg-dark">
						<li class="breadcrumb-item"><a href="../index.html">个人中心</a></li>
						<li class="breadcrumb-item active" aria-current="page">收藏夹</li>
					</ol>
				</nav>
			</div>
		</nav>
	</header>
	<main role="main" class="flex-shrink-0">
		<div id="favorites_html" class="container favorites">
			<%/* 遍历年份 */%>
			<%for (var yearMap of dataMaps) {%>
				<%/* 年份 */%>
				<span class="sidebar-h1" data-tag="h1" data-sidebar="<%:=yearMap[0]%>年"></span>
				<%for (var monthMap of yearMap[1]) {%>
					<%/* 月份 */%>
					<span class="sidebar-h2" data-tag="h2" data-sidebar="<%:=monthMap[0]%>月"></span>
					<%/* 月份数据 */%>
					<%for (let index = 0; index < monthMap[1].length; index++) {%>
						<%const favorite = monthMap[1][index]%>
						<%total = total -1%>
						<div class="card w-70 mt-3 border border-warning">
							<div class="card-body">
								<div class="p-1 comments">
									<div class="container comment  m-1 p-0">
										<a class="me-a avatar p-0 m-0" target="_blank" href="<%:=API.Common.getUserUrl(API.Favorites.getFavoriteOwner(favorite).uin)%>">
											<img class="w-100 h-100 border rounded-circle" src="<%:=API.Common.getUserLogoUrl(API.Favorites.getFavoriteOwner(favorite).uin)%>">
										</a>
										<div class="ml-4">
											<div class="container ml-4">
												<a class="author">
													<a target="_blank" href="<%:=API.Common.getUserUrl(favorite.uin)%>">
														<span><%:=API.Common.formatContent(API.Favorites.getFavoriteOwner(favorite).name)%></span>
													</a>
													<span class="border-warning border rounded text-warning small p-1"><%:=API.Favorites.getType(favorite.type)%></span>
													<br>
													<span class="text-muted small"><%:=favorite.pubtime%></span>
												</a>
											</div>
											<div class="messageText ml-4 container m-2">
												<%if(favorite.shuoshuo_info && favorite.shuoshuo_info.reason){%>
													<p><%:=API.Common.formatContent(favorite.shuoshuo_info.reason,'HTML', false, true)%></p>
													<hr>
												<%}%>
												<%if(favorite.share_info && favorite.share_info.reason){%>
													<p><%:=API.Common.formatContent(favorite.share_info.reason,'HTML', false, true)%></p>
													<hr>
												<%}%>
												<%if(favorite.type === 5){%>
													<%/* 说说 */%>
													<%if(favorite.shuoshuo_info && favorite.shuoshuo_info.detail_shuoshuo_info && favorite.shuoshuo_info.detail_shuoshuo_info.content){%>
														<p><%:=API.Common.formatContent(favorite.shuoshuo_info.detail_shuoshuo_info.content,'HTML', false, false)%></p>
													<%}else{%>
														<p><%:=API.Common.formatContent(favorite.abstract || favorite.desp,'HTML', false, false)%></p>
													<%}%>
												<%}else if(favorite.type === 7){%>
													<%/* 分享 */%>
													<%if(favorite.title){%>
														<p><a target="_blank" href="<%:=favorite.share_info.share_url%>"><%:=favorite.title%></a></p>
													<%}%>
													<%if(favorite.abstract){%>
														<p><%:=API.Common.formatContent(favorite.abstract || favorite.desp,'HTML', false, true)%></p>
													<%}%>
												<%}else if(favorite.type === 3){%>
													<%/* 日志 */%>
													<%if(favorite.title){%>
														<p><a target="_blank" href="http://user.qzone.qq.com/<%:=favorite.blog_info.owner_uin%>/blog/<%:=favorite.blog_info.id%>">《<%:=favorite.title%>》</a></p>
													<%}%>
													<%if(favorite.abstract){%>
														<p><%:=API.Common.formatContent(favorite.abstract,'HTML', false, true)%></p>
													<%}%>
												<%}else{%>
													<p><%:=API.Common.formatContent(favorite.abstract || favorite.desp,'HTML', false, true)%></p>
												<%}%>
											</div>
										</div>
									</div>
								</div>
								<%/* 多媒体内容 */%>
								<div class="medias row p-3 ml-5">
									<%/* 图片内容 */%>
									<%if(favorite.custom_images){%>
										<%for(let image of favorite.custom_images){%>
											<a class="medias-item border" target="_blank" href="<%:=image.custom_filepath || image.custom_url%>">
												<img src="<%:=image.custom_filepath || image.custom_url%>">
											</a>
										<%}%>
									<%}%>
									<%/* 视频内容 */%>
									<%if(favorite.custom_videos){%>
										<%for(let video of favorite.custom_videos){%>
											<%if(video.play_url){%>
												<a class="medias-item border" target="_blank" href="<%:=video.play_url%>">
													<img src="<%:=video.custom_pre_filepath || video.preview_img%>">
												</a>
											<%}else{%>
												<video poster="<%:=video.custom_pre_filepath || video.preview_img%>" src="<%:=video.custom_filepath%>" controls></video>
											<%}%>
										<%}%>
									<%}%>
								</div>
								<%/* 音乐内容（目前PC端已无法正常播放，直接显示专辑图片与歌曲信息） */%>
								<%if(favorite.custom_audios && favorite.custom_audios.length > 0){%>
									<div class="medias row p-3 ml-5 border">
										<ul class="list-unstyled">
											<%for(let music of favorite.custom_audios){%>
												<li>
													<a class="medias-item text-center" href="<%:=music.playurl%>">
														<img src="<%:=music.custom_filepath || music.custom_url%>">
														<span><%:=music.song_name%></span>
													</a>
												</li>
											<%}%>
										</ul>
									</div>
								<%}%>
							</div>
							<div class="card-footer text-muted">
								<%:=API.Common.formatContent(favorite.custom_create_time)%>
								<span class="border-primary border rounded text-primary small p-1 float-right">#<%:=total + 1 %></span>
							</div>
						</div>
					<%}%>
				<%}%>
			<%}%>
		</div>
	</main>
</body>

</html>